An image block includes at least one sample point; therefore, there is a plurality of division methods for the image block, each division method is corresponding to one division template, and the division template is used to determine a partition (partition) corresponding to each sample point (sample point) in the image block. By using the division method, an image block may be divided into two partitions in any shape.
The foregoing image block division method may also be applied to an encoding and decoding technology for a depth map of a three-dimensional video; for example, the foregoing image block division method is also used in a wedgelet (Wedgelet) technology. A principle of the wedgelet technology is as follows: After an image block is divided into two partitions in any shape, encoding and decoding operations are performed on each partition by using a predicted value; therefore, only when both an encoder and a decoder use a same division method, the image block can be correctly restored. In the wedgelet technology, different division templates are used for different image block sizes. For example, for a 4×4 image block, there are 86 division templates; for an 8×8 image block, there are 782 division templates. In the prior art, for an image block of a same size, all division templates of the image block are numbered on an encoder and a decoder in a same numbering manner, and the encoder and the decoder store all the division templates. During encoding, the encoder writes a number of a used division template into a bitstream; after acquiring the number of the division template, the decoder acquires, from all of the stored division templates, the division template corresponding to the number of the division template, so as to learn of the division template used by the encoder, thereby correctly restoring the image block.
However, in the method used in the prior art, a large quantity of division templates need to be stored, which occupies more storage space, thereby increasing a burden on an encoding and decoding system.